


Namespace Ventas
Public Class ComprobanteDetalle



 Public Function Combo(ByVal vTodos As Boolean, Optional ByVal vmensaje As String = "Todos") As Entity.Ventas.ComprobanteDetalleCol
dim objCol as  New entity.Ventas.ComprobanteDetalleCol
dim obj as  New Data.Ventas.ComprobanteDetalle
objCol = obj.Listar("", _
		-1, _
		-1, _
		-1, _
		-1, _
		-1, _
		-1, _
		0.0, _
		0.0, _
		-1, _
		0.0, _
		-1, _
		0.0, _
		0.0)
 If vTodos Then
Dim ent As New Entity.Ventas.ComprobanteDetalle( _ 
		-1, _
		vmensaje , _
		-1, _
		-1, _
		-1, _
		-1, _
		0.0, _
		0.0, _
		-1, _
		0.0, _
		-1, _
		0.0, _
		0.0)
objCol.AddPrimero(ent)
End If
Return objCol
End Function


'***************************


public Function Listar(ComprobanteDetalleId as integer) as Entity.Ventas.ComprobanteDetalle

dim objEnt as  New entity.Ventas.ComprobanteDetalle
dim obj as  New Data.Ventas.ComprobanteDetalle
return obj.Listar(ComprobanteDetalleId)

End Function


'***************************



public Function Listar( _
		ComprobanteDetalleId as Integer, _
		ComprobanteID as Integer, _
		ProductoId as Integer, _
		Cantidad as Integer, _
		StockBase as Integer, _
		StockDespues as Integer, _
		PrecioBase as Double, _
		Precio as Double, _
		DescuentoID as Integer, _
		Descuento as Double, _
		Estado as Integer, _
		SubTotal as Double, _
		Total as Double) _
as  Entity.Ventas.ComprobanteDetalleCol

dim objCol as  New entity.Ventas.ComprobanteDetalleCol
dim obj as  New Data.Ventas.ComprobanteDetalle
return obj.listar("", _
		ComprobanteDetalleId, _
		ComprobanteID, _
		ProductoId, _
		Cantidad, _
		StockBase, _
		StockDespues, _
		PrecioBase, _
		Precio, _
		DescuentoID, _
		Descuento, _
		Estado, _
		SubTotal, _
		Total)

End Function


'***************************


public Function Grabar( _
		ComprobanteDetalleId as Integer, _
		ComprobanteID as Integer, _
		ProductoId as Integer, _
		Cantidad as Integer, _
		StockBase as Integer, _
		StockDespues as Integer, _
		PrecioBase as Double, _
		Precio as Double, _
		DescuentoID as Integer, _
		Descuento as Double, _
		Estado as Integer, _
		SubTotal as Double, _
		Total as Double, _
vUSuario as integer)as  integer

dim _codigo as integer =-1
dim obj as  New Data.Ventas.ComprobanteDetalle
 if ComprobanteDetalleId=-1 then 
_codigo= obj.insert( "", _
		ComprobanteDetalleId , _
		ComprobanteID , _
		ProductoId , _
		Cantidad , _
		StockBase , _
		StockDespues , _
		PrecioBase , _
		Precio , _
		DescuentoID , _
		Descuento , _
		Estado , _
		SubTotal , _
		Total , _
 vUSuario )
else
_codigo= obj.update( "", _
		ComprobanteDetalleId , _
		ComprobanteID , _
		ProductoId , _
		Cantidad , _
		StockBase , _
		StockDespues , _
		PrecioBase , _
		Precio , _
		DescuentoID , _
		Descuento , _
		Estado , _
		SubTotal , _
		Total , _
 vUSuario )
end if 
return _codigo

End Function


'***************************


public Function Insertar( _
		ComprobanteDetalleId as Integer, _
		ComprobanteID as Integer, _
		ProductoId as Integer, _
		Cantidad as Integer, _
		StockBase as Integer, _
		StockDespues as Integer, _
		PrecioBase as Double, _
		Precio as Double, _
		DescuentoID as Integer, _
		Descuento as Double, _
		Estado as Integer, _
		SubTotal as Double, _
		Total as Double, _
vUSuario as integer)as  integer

dim _codigo as integer =-1
dim obj as  New Data.Ventas.ComprobanteDetalle
_codigo= obj.insert( "", _
		ComprobanteDetalleId, _
		ComprobanteID, _
		ProductoId, _
		Cantidad, _
		StockBase, _
		StockDespues, _
		PrecioBase, _
		Precio, _
		DescuentoID, _
		Descuento, _
		Estado, _
		SubTotal, _
		Total, _
 vUSuario )
return _codigo

End Function


'***************************


public Function Updatear( _
		ComprobanteDetalleId as Integer, _
		ComprobanteID as Integer, _
		ProductoId as Integer, _
		Cantidad as Integer, _
		StockBase as Integer, _
		StockDespues as Integer, _
		PrecioBase as Double, _
		Precio as Double, _
		DescuentoID as Integer, _
		Descuento as Double, _
		Estado as Integer, _
		SubTotal as Double, _
		Total as Double, _
vUSuario as integer)as  integer

dim _codigo as integer =-1
dim obj as  New Data.Ventas.ComprobanteDetalle
_codigo= obj.Update( "", _
		ComprobanteDetalleId , _
		ComprobanteID , _
		ProductoId , _
		Cantidad , _
		StockBase , _
		StockDespues , _
		PrecioBase , _
		Precio , _
		DescuentoID , _
		Descuento , _
		Estado , _
		SubTotal , _
		Total , _
 vUSuario )
return _codigo

End Function


'***************************


public Function ELiminar(  ComprobanteDetalleId as integer,vusuario as integer ,optional vopcion as string="Delete") as integer
dim _codigo as integer =-1
dim obj as  New Data.Ventas.ComprobanteDetalle
_codigo= obj.Eliminar( "vopcion", ComprobanteDetalleId ,vusuario)
return _codigo

End Function

End Class



end namespace

